<html>
<head><meta charset="utf-8"><title>action for cargo install · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/action.20for.20cargo.20install.html">action for cargo install</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204900180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/action%20for%20cargo%20install/near/204900180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pickfire <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/action.20for.20cargo.20install.html#204900180">(Jul 24 2020 at 10:28)</a>:</h4>
<div class="codehilite"><pre><span></span><code>&gt; cargo install --git https://github.com/drahnr/cargo-spellcheck
    Updating git repository `https://github.com/drahnr/cargo-spellcheck`
error: multiple packages with binaries found: cargo-spellcheck, cargo-spellcheck-demo
</code></pre></div>


<p>The message is quite cryptic, I then tried</p>
<div class="codehilite"><pre><span></span><code>&gt; cargo install --git https://github.com/drahnr/cargo-spellcheck --bin cargo-spellcheck
    Updating git repository `https://github.com/drahnr/cargo-spellcheck`
error: multiple packages with binaries found: cargo-spellcheck, cargo-spellcheck-demo
</code></pre></div>


<p>Is this the expected thing to be done? Maybe there should be a suggestion for users to use <code>--bin</code>?</p>



<a name="204900252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/action%20for%20cargo%20install/near/204900252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/action.20for.20cargo.20install.html#204900252">(Jul 24 2020 at 10:29)</a>:</h4>
<p>You need to use <code>cargo install --git https://github.com/drahnr/cargo-spellcheck cargo-spellcheck</code>. The error doesn't say there is a package with multiple binaries, but there are multiple packages in the git repo which have one or more binaries.</p>



<a name="204900755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/action%20for%20cargo%20install/near/204900755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pickfire <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/action.20for.20cargo.20install.html#204900755">(Jul 24 2020 at 10:35)</a>:</h4>
<p>Yeah, I just realized it should be <code>cargo install --git https://github.com/drahnr/cargo-spellcheck cargo-spellcheck</code>. The reason I didn't try that because I don't know <code>package</code> means <code>crate</code>. I thought <code>--git</code> itself means the crate is specified, IIRC when I specify <code>--git</code> I don't need to specify <code>[crate]</code>. </p>
<div class="codehilite"><pre><span></span><code>&gt; cargo install --help
cargo-install
Install a Rust binary. Default location is $HOME/.cargo/bin

USAGE:
    cargo install [OPTIONS] [--] [crate]...
</code></pre></div>


<p>Maybe it would be better to show</p>
<div class="codehilite"><pre><span></span><code>    Updating git repository `https://github.com/drahnr/cargo-spellcheck`
error: multiple crates with binaries found: cargo-spellcheck, cargo-spellcheck-demo
 note: try `cargo install --git https://github.com/drahnr/cargo-spellcheck cargo-spellcheck`
</code></pre></div>



<a name="204900989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/action%20for%20cargo%20install/near/204900989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/action.20for.20cargo.20install.html#204900989">(Jul 24 2020 at 10:38)</a>:</h4>
<p>There is a difference between package and crate. Crate is a rustc concept. It is an executable or library. Package is a cargo concept. It is a collection of at most one library combined with zero or more binaries, tests, examples, etc. 1 <code>Cargo.toml</code> == 1 package. 1 rustc invocation == 1 crate.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>